function [f_min_max, min_max_err] = get_mn(lower, upper, m, n, r, k)
fprintf('Minimax running....\n');
f = 0.0;
min_max_err = 0.0;
f_min_max = 0.0;
max_err = 0.0;
step_f = 2^(-n-k);
max_nstep = floor(1.0/step_f);
step = 2^(-n);
index = 0;
for i = 0:step_f:1
    tStart = tic;
    index = index + 1;
    max_err_mn = 0;
    for a = lower:step:upper
        for b = a:step:upper
            ans_true = a * b;
           
            ans_mn = trunc_mult(a, b, f, m, n, r, k);
            err_mn = abs(ans_mn - ans_true);
            max_err_mn = max([err_mn, max_err_mn]);
        end
    end
    if i == 0
        min_max_err = max_err_mn;
        max_err = max_err_mn;
        max_nstep = floor(max_err/step_f);
    else
        if max_err_mn <= min_max_err
            min_max_err = max_err_mn;
            f_min_max = f;                    
        end
        if f > max_err/2
            break;
        end
    end        
    f = f + step_f;
    tLoop = toc(tStart);
    tLeft = tLoop * (max_nstep - index);
    fprintf('\t\tMax_Step: %d - Index: %d, Time: %s - Left: %f hrs \n', max_nstep, index, datestr(datenum(0,0,0,0,0,tLoop),'HH:MM:SS'),tLeft/3600.0);
end
fprintf('Minimax completed...\n');
end